{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "175f59e9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n"
     ]
    }
   ],
   "source": [
    "print(2+2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fda2a494",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "4*5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "18f68d9f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.3333333333333335"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10/3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "3dfba553",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10%3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "d7728001",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2**3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "be372754",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2*2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "c0cdeca4",
   "metadata": {},
   "outputs": [],
   "source": [
    "tang=3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "eba14c75",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "271ffbd3",
   "metadata": {},
   "outputs": [],
   "source": [
    "tang=1.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a518f73a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "float"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(tang)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "9dee54d8",
   "metadata": {},
   "outputs": [],
   "source": [
    "tang2=int(tang)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "f4ae6a8e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type (tang2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "f2f29bd8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "float"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(float(tang2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "944791a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "57e8d32e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "str"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang_str=\"123\"\n",
    "type(tang_str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "d7222f5d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "123.0"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "float(tang_str)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "3753fb49",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'123'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "str(123)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3d36eb91",
   "metadata": {},
   "source": [
    "## 计算先后顺序\n",
    "- ()\n",
    "- [**]\n",
    "- */\n",
    "- +-\n",
    "基本数值操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "bbde848e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "C:\\Users\\MI\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "print(os.path.abspath(\"\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9173d371",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
